package com.cskaoyan.bean.vo.wx.auth;

import com.cskaoyan.bean.MarketAdmin;
import com.cskaoyan.bean.MarketUser;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: bwj
 * @Date: 2022/09/11/13:39
 * @Description:
 */

public class WxUserUtil {
    //获取user表用户信息
    public static MarketUser userUtil() {
        Subject subject = SecurityUtils.getSubject();
        MarketUser user = (MarketUser) subject.getPrincipals().getPrimaryPrincipal();
        return user;
    }

    //获取admin表用户信息
    public static MarketAdmin adminUtil() {
        Subject subject = SecurityUtils.getSubject();
        MarketAdmin admin = (MarketAdmin) subject.getPrincipals().getPrimaryPrincipal();
        return admin;
    }
}
